<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ include file="/page/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<%@ include file="/adapter/adapter-bootstrap.jsp" %>
<script type="text/javascript">
	var basePageMake = "${ctx}/auth/appPushMessage";
	
	function rowClickAfter(rowIndex,pk_id) {

		var  arrId = document.getElementsByName("check");
		arrId[rowIndex -1 ].checked=true;	
	}

	//新增
	function doSaleSiteAdd(){
		window.location.href="${ctx}/appSaleSite/jumpAddSaleSite?appid=${appid}";
	}
	//修改
	function doSaleSiteEdit(){
		if(saleSiteId==null){
			alert("请选择一条记录！");
		}else{
			window.location.href="${ctx}/appSaleSite/jumpUpdateSaleSite?appid=${appid}&saleSiteId="+saleSiteId;
		}
	}
	//删除
	function doSaleSiteDelete(){
		if(saleSiteId==null){
			alert("请选择一条记录！");
		}else{
			if(confirm("确认删除吗？")){
				window.location.href="${ctx}/appSaleSite/deleteSaleSite?appid=${appid}&saleSiteId="+saleSiteId;
				window.location.reload();
			}
		}
	}
	//查看
	function doSaleSiteView(){

		if(saleSiteId==null){
			alert("请选择一条记录！");
		}else{
				window.location.href="${ctx}/appSaleSite/querySaleSiteDetail?appid=${appid}&saleSiteId="+saleSiteId;
		}
	}	
	
</script>
</head>
<body>
<div class="panel panel-default">
   <div class="panel-heading">
      <h3 class="panel-title">
          请输入查询条件
      </h3>
   </div>
   <div class="panel-body">
<form class="form-horizontal" role="form"  method="post"  action="${ctx}/auth/appSaleSiteList?appid=${appid}">
                       <div class="form-group">
                          <label class="col-xs-2 control-label" for="saleSiteId">商户网点编号：</label>
                          <div class="col-xs-3">
                             <input class="input-sm form-control" id="saleSiteId" name="saleSiteId" type="text" value="${saleSiteId}"/>
                          </div>
                          <label class="col-xs-2 control-label" for="saleSiteName">商户网点名称：</label>
                          <div class="col-xs-3">
                             <input class="input-sm form-control" id="saleSiteName"  name="saleSiteName"  type="text" value="${saleSiteName}"/>
                          </div>                          
                          <div class="col-xs-2">
                          	 <button type="submit" class="btn btn-default btn-sm" >查询</button>              
                          </div>
                       </div>
                </form>
   </div>
</div>
			<div class="op-btn">
				<input type="button" class="btn btn-default" value="新增"  onclick="doSaleSiteAdd()"/> 
				<input type="button" class="btn btn-default" value="修改"  onclick="doSaleSiteEdit()"/>
				<input type="button" class="btn btn-default" value="删除"  onclick="doSaleSiteDelete()"/>				
				<input type="button" class="btn btn-default" value="查看"  onclick="doSaleSiteView()"/>
			</div>	
<macms:table dataListName="assList">
	<macms:html id="ch" label="选择" innerHtml="<input type=\"radio\" name=\"check\" value=\"15\">"></macms:html>
	<macms:text id="sale_site_id" label="商户网点编号" align="center"></macms:text>
	<macms:text id="sale_site_name" label="商户网点名称" align="center"></macms:text>
	<macms:text id="sale_site_address" label="商户网点地址" align="center"></macms:text>
	<macms:text id="sale_site_longitude" label="商户网点精度坐标" align="center"></macms:text>
	<macms:text id="sale_site_latitude" label="商户网点纬度坐标" align="center"></macms:text>
	<macms:text id="sale_site_desc" label="商户网点描述" align="center"></macms:text>
	<macms:text id="sale_site_tel" label="联系电话" align="center"></macms:text>
	<macms:text id="sale_site_type" label="类型" dictname="APP_SITE_TYPE_DIC" align="center"></macms:text>

</macms:table>
<script type="text/javascript">
	var preRow = null;
	var saleSiteId;
	$('tbody tr').bind('click', function() {
	
		var rowIndex = $(this).prevAll().length+1;
		if(rowIndex <1) return;
		
		if(preRow != null){
			preRow.removeClass("active");
		}
		$(this).addClass("active");
		preRow = $(this);
		saleSiteId=$(this).find("td").eq(1).text();

		// 行单击后事件(传入行号，页面标识)
		rowClickAfter(rowIndex,
				$(this).find("td").eq(1).text());
	});
</script>
</body>
</html>
